import request from '@/utils/request'

export function adminDel (pram) {
  const data = {
    id: pram.id
  }
  return request({
    url: '/admin/system/admin/delete',
    method: 'GET',
    params: data
  })
}

export function adminList (params) {
  return request({
    url: '/admin/system/admin/list',
    method: 'GET',
    params
  })
}

export function adminAdd (param) {
  const data = {
    account: param.account,
    level: param.level,
    pwd: param.pwd,
    realName: param.realName,
    roles: param.roles.join(','),
    status: param.status
  }

  return request.post('/admin/system/admin/add', data)
}

export function adminUpdate (params) {
  return request.post('/admin/system/admin/update', params)
}
